/**
 * @file Logger.h
 * @author rui.liang (rui.liang@ruhnix.com)
 * @brief
 * @version 1.0
 * @date 2025-09-14
 *
 * @copyright Copyright (c) 2025
 *
 */

#ifndef LOGGER_H
#define LOGGER_H

#include <QLabel>
#include <QString>

class QTextEdit;

class Logger : public QObject {
    Q_OBJECT

  public:
    explicit Logger(QTextEdit *outputWidget, QObject *parent = nullptr);

    // 记录日志的方法
    void log(const QString &message);
    void log(const std::string &message);
    void log(const char *message);

  signals:
    // 用于更新日志到 QTextEdit 的信号
    void logMessage(const QString &message);

  private:
    QTextEdit *m_outputWidget;
};

#endif // LOGGER_H
